<?php
class AttrsModel extends MongoModel{
	var $table = 'attrs';
    var $name = '自定义属性';
	
	public static function get_attr_types(){
		return array(
			'input' 		=> array('name'=>'单行文本框', 	'trait'=>array('text'=>'普通文本', 'date'=>'日期', 'mail'=>'邮箱', 'url'=>'链接', 'num'=>'数字', 'password'=>'密码', 'code'=>'编码', 'mutil'=>'多项文本')),
			'textarea' 		=> array('name'=>'多行文本框', 	'trait'=>array('normal'=>'普通','editor'=>'高级编辑器')),
			'selector' 		=> array('name'=>'选择框', 		'trait'=>array('single'=>'单选框','multiple'=>'多选框','select'=>'下拉框','target'=>'链接目标')),
			'file_selector' => array('name'=>'文件选择器', 	'trait'=>array('template'=>'模板文件','dir'=>'目录')),
			'image'			=> array('name'=>'图片',			'trait'=>array('single'=>'单选','multiple'=>'多选')),
			'captchar' 		=> array('name'=>'验证码'),
			'map' 			=> array('name'=>'地图', 		'trait'=>array('google'=>'谷歌','baidu'=>'百度')),
			'relation' 		=> array('name'=>'关联属性',		'trait'=>array('single'=>'单选','multiple'=>'多选')),
			'role' 			=> array('name'=>'用户角色',		'trait'=>array('single'=>'单选','multiple'=>'多选')),
			'cate' 			=> array('name'=>'分类', 		'trait'=>array('single'=>'单选','multiple'=>'多选')),
			'user_level' 	=> array('name'=>'会员级别', 	'trait'=>array('single'=>'单选','multiple'=>'多选')),
			'attr_group' 	=> array('name'=>'属性组', 		'trait'=>array('single'=>'单选','multiple'=>'多选')),
			'related' 		=> array('name'=>'关联对象', 	'trait'=>array('goods'=>'商品','image'=>'图组','article'=>'文章')),
			'show360'		=> array('name'=>'360度展示'),
			'form_item'		=> array('name'=>'表单项'),
			'forms'			=> array('name'=>'表单'),
		);
	}
	
	public static function get_cate_types(){
		return array(
			'goods' 	=> '商品分类', 
			'article' 	=> '文章分类',
			'navigate'	=> '导航栏',
		);
	}
	
	public static function get_attr_options(){
		$configs = self::get_attr_types();
		$options = array();
		foreach($configs as $name=>$config){
			$options[$name] = $config['name'];
		}
		return $options;
	}
}
?>